<?php

/**
 * @author thihien
 * @copyright 2011
 */
require_once('includes/general.php');
if(!tep_db_checkDb()) die('khong ket noi dc csdl');
$sql='select * from tbl_fqas, tbl_lien_he where tbl_fqas.ma_nguoi_lien_he=tbl_lien_he.id and tra_loi=1';
$kq=tep_db_query($sql);
$content='';
if($_SESSION['nn']=='vn'){
$content.='<div id="center">
        <div class="tieude_dm"><h3>fqas</h3></div>';
    
while($item=tep_db_fetch_array($kq)){
    $content.='<div class="tieude_fqas"><a href="?page=FQAs&mafqas='.$item['id'].'&macantraloi='.$item['ma_nguoi_lien_he'].'&mode=detail">'.$item['noi_dung_vn'].'</a></div>';
}
$content.='</div>';
if(isset($_GET['mode'])&& $_GET['mode']=='detail'){
    $mafqas=$_GET['mafqas'];
    $malienhe=$_GET['macantraloi'];
    $sql='select * from tbl_lien_he where id='.$malienhe;
    $kq=tep_db_query($sql);
    $item=tep_db_fetch_array($kq);
    $content='';
    $content.='<div id="center">
        <div class="tieude_dm"><h3>fqas</h3></div>
        <div class="tieude_fqas">'.$item['noi_dung_vn'].'</div>
        ';
        
        $sql1='select * from tbl_fqas where id='.$mafqas;
        $kq1=tep_db_query($sql1);
        $item1=tep_db_fetch_array($kq1);
        $content.='<div class="noidung_traloi">'.$item1['noi_dung_tra_loi_vn'].'</div>';
    $content.='</div>';    
}
}
if($_SESSION['nn']=='en'){
    $content.='<div id="center">
        <div class="tieude_dm"><h3>fqas</h3></div>';
    
while($item1=tep_db_fetch_array($kq)){
    $content.='<div class="tieude_fqas"><a href="?page=FQAs&mafqas='.$item1['id'].'&macantraloi='.$item1['ma_nguoi_lien_he'].'&mode=detail">'.$item1['noi_dung_en'].'</a></div>';
}
$content.='</div>';
if(isset($_GET['mode'])&& $_GET['mode']=='detail'){
    $mafqas=$_GET['mafqas'];
    $malienhe=$_GET['macantraloi'];
    $sql='select * from tbl_lien_he where id='.$malienhe;
    $kq=tep_db_query($sql);
    $item=tep_db_fetch_array($kq);
    $content='';
    $content.='<div id="center">
        <div class="tieude_dm"><h3>fqas</h3></div>
        <div class="tieude_fqas">'.$item['noi_dung_en'].'</div>
        ';
        
        $sql1='select * from tbl_fqas where id='.$mafqas;
        $kq1=tep_db_query($sql1);
        $item1=tep_db_fetch_array($kq1);
        $content.='<div class="noidung_traloi">'.$item1['noi_dung_tra_loi_en'].'</div>';
    $content.='</div>';    
}
}
echo $content;
?>